package com.luke.star.persist.mapper;

import com.luke.star.persist.po.StWxMsg;
import com.luke.star.persist.po.StWxMsgExample;
import java.util.List;
import org.apache.ibatis.annotations.DeleteProvider;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.SelectProvider;
import org.apache.ibatis.annotations.UpdateProvider;
import org.apache.ibatis.type.JdbcType;

public interface StWxMsgMapper {
    @SelectProvider(type=StWxMsgSqlProvider.class, method="countByExample")
    long countByExample(StWxMsgExample example);

    @DeleteProvider(type=StWxMsgSqlProvider.class, method="deleteByExample")
    int deleteByExample(StWxMsgExample example);

    @Insert({
        "insert into st_wx_msg (msgid, userid, ",
        "msg_content, create_time, ",
        "update_time, state, ",
        "rescode, resmsg)",
        "values (#{msgid,jdbcType=VARCHAR}, #{userid,jdbcType=VARCHAR}, ",
        "#{msgContent,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, ",
        "#{updateTime,jdbcType=TIMESTAMP}, #{state,jdbcType=CHAR}, ",
        "#{rescode,jdbcType=VARCHAR}, #{resmsg,jdbcType=VARCHAR})"
    })
    int insert(StWxMsg record);

    @InsertProvider(type=StWxMsgSqlProvider.class, method="insertSelective")
    int insertSelective(StWxMsg record);

    @SelectProvider(type=StWxMsgSqlProvider.class, method="selectByExample")
    @Results({
        @Result(column="msgid", property="msgid", jdbcType=JdbcType.VARCHAR),
        @Result(column="userid", property="userid", jdbcType=JdbcType.VARCHAR),
        @Result(column="msg_content", property="msgContent", jdbcType=JdbcType.VARCHAR),
        @Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="update_time", property="updateTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="state", property="state", jdbcType=JdbcType.CHAR),
        @Result(column="rescode", property="rescode", jdbcType=JdbcType.VARCHAR),
        @Result(column="resmsg", property="resmsg", jdbcType=JdbcType.VARCHAR)
    })
    List<StWxMsg> selectByExample(StWxMsgExample example);

    @UpdateProvider(type=StWxMsgSqlProvider.class, method="updateByExampleSelective")
    int updateByExampleSelective(@Param("record") StWxMsg record, @Param("example") StWxMsgExample example);

    @UpdateProvider(type=StWxMsgSqlProvider.class, method="updateByExample")
    int updateByExample(@Param("record") StWxMsg record, @Param("example") StWxMsgExample example);
}